(() => {
    //我们设计红绿灯系统 0代表绿灯 1代表红灯 2代表黄灯

    enum Color {
        green,
        red,
        yellow
    }

    console.log(Color.green);//0
    console.log(Color.red);//1
    console.log(Color.yellow);//2

    console.log(Color[0]);
    console.log(Color[1]);
    console.log(Color[2]);


    //如果给某个枚举的值设置值 则接下来的值就会一次顺延
    enum boxLocal {
        left = 2,//2
        right,//3
        top,//4
        bottom,//5

    }
    console.log(boxLocal.left);//2
    console.log(boxLocal.right);//3
    console.log(boxLocal.top);//4
    console.log(boxLocal.bottom);//5

})()